<?php   

class News extends Controller {

	function News()
	{
		parent::Controller();	
        $this->load->model('newsmodel');                           
	}
	
    function index()
    {                                    
                                                          
        //news item
        $data["news_item"] = $this->newsmodel->get_latest_news_item();   

        //news list                                          
        $data["grouped_list"] = $this->newsmodel->get_list();

        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "News")); 
        $this->load->view('website/default/header');  
        $this->load->view('website/news/news', $data);   
        $this->load->view('website/default/footer');   

    }

    function month($month = '')
    {                                    

        //news list
        $data["grouped_list"] = $this->newsmodel->get_list($month); 
        if (empty($data["grouped_list"])) show_404(); 

        //activate layout variant for 'month page'
        $data["use_month_layout"] = TRUE;
  
        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "News")); 
        $this->load->view('website/default/header');  
        $this->load->view('website/news/news', $data);   
        $this->load->view('website/default/footer');   

    }

    function view($id = NULL)
    {

        $this->load->model('glossarymodel');

        //news item
        $data["news_item"] = $this->newsmodel->get_item($id); 
        if (empty($data["news_item"])) show_404();                                              

        //news list
        $data["grouped_list"] = $this->newsmodel->get_list();      
  
        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "News - " .$data["news_item"]["Title_News"])); 
        $this->load->view('website/default/header');  
        $this->load->view('website/news/news_detail', $data);   
        $this->load->view('website/default/footer');   

    }

}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */